home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / filarry.exe / FILARRAY.H < prev    next >
C/C++ Source or Header  |  1993-04-16  |  772b  |  37 lines

  1. // FILARRAY.H : a file array class
  2. // Author     : Jian Hua, 04/01/93
  3. // Compiler   : Borland C++ 3.1
  4. // (c) Jian Hua. Source may be used freely if author is acknowledged.
  5. // Object files may be used freely
  6.  
  7. #ifndef __FILARRAY_H
  8. #define __FILARRAY_H
  9. #include <fstream.h>
  10.  
  11. struct SDTHEADER
  12. {
  13.     char first; // will be set 0x1A
  14.     int  id;    // will be set í=161
  15.     long strCtxLen; // string context area len
  16.     int  offsetArraySize; // offset array size
  17.     // offset array area len = offsetArraySize * sizeof(long)
  18. };
  19.  
  20. class FileArray
  21. {
  22. public:
  23.     FileArray(const char* = "iep.sdt");
  24.     ~FileArray();
  25.     char* operator[](int ndx);
  26.  
  27. private:
  28.     void updatePtr(int len);
  29.     SDTHEADER headInfo;
  30.     ifstream is;
  31.     char* ptrStr[5];
  32.     int count;
  33.     int OK;
  34. };
  35.  
  36. #endif
  37.